The bearing device for the wheel has been evolved from what is called a first generation structure, which singly uses a double row roller bearing, to a second generation which integrally has a vehicle body attaching flange with an outer member, and has been further developed to a third generation in which one inner raceway surface of the double row roller bearing is integrally formed on an outer circumference of a hub wheel integrally having a wheel attaching flange, and moreover to a fourth generation in which a constant velocity universal joint is integrated into a hub wheel, and the other inner raceway surface of the double row roller bearing is integrally formed on an outer circumference of an outer joint member constructing the constant velocity universal joint.
For example, a structure called the third generation is described in patent document 1. As shown in FIG. 21, the bearing device for the wheel called the third generation is provided with a hub wheel 152 having a flange 151 extending in an outer diameter direction, a constant velocity universal joint 154 having an outer joint member 153 fixed to the hub wheel 152, and an outer member 155 arranged in an outer peripheral side of the hub wheel 152.
The constant velocity universal joint 154 is provided with the outer joint member 153, an inner joint member 158 arranged within a bowl-shaped portion 157 of the outer joint member 153, a ball 159 arranged between the inner joint member 158 and the outer joint member 153, and a cage 160 retaining the ball 159. Further, a spline portion 161 is formed on an inner circumferential surface of a center hole of the inner joint member 158, an end portion spline portion of a shaft (not shown) is inserted to the center hole, and the spline portion 161 at the inner joint member 158 is engaged with the spline portion at the shaft.
Further, the hub wheel 152 has a tubular shaft portion 163 and the flange 151, and an outer end surface 164 (an end surface on the opposite joint side) of the flange 151 is provided in a protruding manner with a short tubular pilot portion 165 to which a wheel and a brake rotor, not shown, are installed. The pilot portion 165 is constructed by a large diameter first portion 165a and a small diameter second portion 165b, the brake rotor is externally fitted to the first portion 165a, and the wheel is externally fitted to the second portion 165b. 
Further, a notch portion 166 is provided on an outer circumferential surface of an end portion at the bowl-shaped portion 157 of the shaft portion 163, and an inner joint member 167 is fitted to the notch portion 166. A first inner raceway surface 168 is provided in the vicinity of the flange of an outer circumferential surface of the shaft portion 163 of the hub wheel 152, and a second inner raceway surface 169 is provided on an outer circumferential surface of the inner joint member 167. Further, a bolt mounting hole 162 is provided on the flange 151 of the hub wheel 152, and a hub bolt for fixing the wheel and the brake rotor to the flange 151 is mounted to the bolt mounting hole 162.
The outer member 155 is provided with two rows of outer raceway surfaces 170 and 171 on its inner circumference, and is provided with the flange (the vehicle body attaching flange) 151 on its outer circumference. Further, the first outer raceway surface 170 of the outer member 155 is opposed to the first inner raceway surface 168 of the hub wheel 152, the second outer raceway surface 171 of the outer member 155 is opposed to the raceway surface 169 of the inner joint member 167, and a rolling element 172 is interposed between the foregoing.
A shaft portion 173 of the outer joint member 153 is inserted to the shaft portion 163 of the hub wheel 152. In the shaft portion 173, a thread portion 174 is formed in an end portion of an opposite bowl-shaped portion, and a spline portion 175 is formed between the thread portion 174 and the bowl-shaped portion 157. Further, a spline portion 176 is formed on an inner circumferential surface (an inner surface) of the shaft portion 163 of the hub wheel 152, and when the shaft portion 173 is inserted to the shaft portion 163 of the hub wheel 152, the spline portion 175 at the shaft portion 173 is engaged with the spline portion 176 at the hub wheel 152.
Further, a nut member 177 is screwed to the thread portion 174 of the shaft portion 173 protruding from the shaft portion 163, and the hub wheel 152 and the outer joint member 153 are coupled to each other. At this time, an inner end surface (a back surface) 178 of the nut member 177 comes into contact with an outer end surface 179 of the shaft portion 163, and an end surface 180 at the shaft portion of the bowl-shaped portion 157 comes into contact with an outer end surface 181 of the inner joint member 167. In other words, by fastening the nut member 177, the hub wheel 152 is pinched by the nut member 177 and the bowl-shaped portion 157 via the inner joint member 167.    Patent Document 1: Japanese Unexamined Patent Publication No. 2004-340311